<table class="<%= table_css_classes('table-fixed') %>">
  <thead>
    <tr>
      <% unless params[:host_id] %>
      <th><%= sort :host, :as => _("Host") %></th>
      <% end %>
      <th><%= sort :reported, :as => _("Last report") %></th>
      <th class="col-md-1 fact-origin"><%= sort :origin, :as => _('Origin') %></th>
      <th class="col-md-1"><%= sort :applied, :as => _("Applied") %></th>
      <th class="col-md-1"><%= sort :restarted, :as => _("Restarted") %></th>
      <th class="col-md-1"><%= sort :failed, :as => _("Failed") %></th>
      <th class="col-md-1"><%= sort :failed_restarts, :as => _("Restart<br>Failures").html_safe %></th>
      <th class="col-md-1"><%= sort :skipped, :as => _("Skipped") %></th>
      <th class="col-md-1"><%= sort :pending, :as => _("Pending") %></th>
      <th class="col-md-1"><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% for report in @config_reports %>
      <tr>
        <% if params[:host_id].nil? %>
          <% if report.host.nil? %>
              <td></td>
          <% else %>
              <td class="ellipsis"><%= link_to report.host, host_config_reports_path(report.host) %></td>
          <% end %>
        <% end %>
        <td><%= reported_at_column(report) %></td>
        <td class="fact-origin"><%= report_origin_icon(report.origin) %></td>
        <td><%= report_event_column(report.applied_s, "label-info") %></td>
        <td><%= report_event_column(report.restarted_s, "label-info") %></td>
        <td><%= report_event_column(report.failed_s, "label-danger") %></td>
        <td><%= report_event_column(report.failed_restarts_s, "label-warning") %></td>
        <td><%= report_event_column(report.skipped_s, "label-info") %></td>
        <td><%= report_event_column(report.pending_s, "label-info") %></td>
        <td>
          <%= action_buttons(display_delete_if_authorized hash_for_config_report_path(:id => report).merge(:auth_object => report, :authorizer => authorizer),
                             :data => {:confirm => _("Delete report for %s?") % report.host.try(:name)}) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @config_reports %>
